using System; 
using System.Collections.Generic; 
using System.Text; 
using FluentNHibernate.Mapping;

namespace Pcme.Info.MvcMusicStore.Models {
    
    
    public partial class AlbumMap : ClassMap<Album> {
        
        public AlbumMap() {
			Table("Album");
			LazyLoad();
			Id(x => x.AlbumId).GeneratedBy.Identity().Column("AlbumId");
			References(x => x.Genre).Column("GenreId");
			References(x => x.Artist).Column("ArtistId");
			Map(x => x.Title).Not.Nullable().Column("Title");
			Map(x => x.Price).Not.Nullable().Column("Price");
			Map(x => x.AlbumArtUrl).Column("AlbumArtUrl");
            HasMany(x => x.Carts).KeyColumn("AlbumId");
            HasMany(x => x.OrderDetails).KeyColumn("AlbumId");
        }
    }
}
